<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>ajax</title>
    <script type="text/javascript" src='./jquery-1.8.3.min.js'></script>
</head>
<body>
    <form id="msg_box" >
        <input type="textarea" id='num' name="content">
    </form>
    <button onclick="senddb()">发送</button>

<script type="text/javascript">


    function senddb(){
        // var info = $('#msg_box input').serialize();
        var info = $('#num').val();
        console.log(info);
        $.ajax({
            type: 'get',
            url: './ajax.php',
            data: {'content':info,'type':'user'},
            // dataType : 'json',
            success: function(data){
                console.log(data);
            }
        })
        
    }

</script>
</body>
</html>